package erp.education.web.action.setup.school;

import org.springframework.beans.factory.annotation.Autowired;

import com.opensymphony.xwork2.ModelDriven;

import erp.education.client.setup.school.BranchRequest;
import erp.education.server.beans.interfaces.setup.school.BranchsServiceI;
import erp.education.web.common.BaseAction;

public class BranchsAction extends BaseAction implements
		ModelDriven<BranchRequest> {
	@Autowired
	BranchRequest branchsRequest;
	@Autowired
	BranchsServiceI branchsService;

	public String branchsLoad() throws Exception {

		this.result = branchsService.branchsLoadSevice(branchsRequest)
				.getResponseObject();
		getRequest().setAttribute("result", this.result.getResultList());

		return "loadBranchs";
	}

	public String saveUpdateBranchDetails() throws Exception {
		this.result = branchsService.saveUpdateBranchDetails(branchsRequest)
				.getResponseObject();

		return "loadBranchs";
	}

	@Override
	public BranchRequest getModel() {
		return this.branchsRequest;
	}
}
